package com.itheima.mycharset;

import java.io.FileReader;
import java.io.IOException;

public class CharSetDemo3 {
    public static void main(String[] args) throws IOException {
        //带参的read方法

        FileReader fr = new FileReader("day28-code\\b.txt");

        char[] chars = new char[2];
        int len;
        while ((len=fr.read(chars))!=-1){
            //把数组中的数据变成字符串进行打印
            //System.out.print(len);
            System.out.print(new String(chars,0,len));
        }
    }
}
